﻿using System;
using System.Collections.Generic;
using System.Text;
using EM.OA.DataModel.DBModel;
using EM.OA.DAL;
using System.Data.Objects;
using System.Linq;
using EM.FrameWork.Paging;
using System.Collections;
using System.Reflection;

namespace EM.OA.BLL 
{
	public class WFFlowConfigBLL : BLLBase<EMOA_WF_FlowConfig>
	{
        public PagedList<EMOA_WF_FlowConfig> GetConfigList(EMOA_WF_FlowConfig model ,PageEntity pageEntity)
        {
            using (var db = new EMOAContext())
            {
                var list = from q in db.EMOA_WF_FlowConfig
                           orderby q.FlowConfigID
                           select new
                           {
                               q,
                               FlowKindName = (from d in db.EMOA_Dictionary where d.DictionaryID == q.FlowKind select d.DictionaryName).FirstOrDefault()
                           };

                return EM.FrameWork.Common.GenerateComplexObject<EMOA_WF_FlowConfig>(list.ToList()).ToPagedList(pageEntity.PageIndex, pageEntity.PageSize);
            }
        }

	}

    
}